<?php

namespace Celebrio\Database;

use Nette\Object;

/**
 * Contains the common functionality of dibi-based Celebrio database
 * modules.
 *
 * @author pavel
 */
abstract class DatabaseDriver extends Object {

    public function dbfSubstr($string, $from, $for = null) {
        if ($for === null) {
            return "substring(" . $string . ", " . $from . ", " . $this->dbfStrlen($string) . ")";
        } else {
            return "substring(" . $string . ", " . $from . ", " . $for . ")";
        }
    }
}